1. Technical Field
The present invention relates to data prefetching in general, and, in particular, to a method and apparatus for performing data prefetch. Still more particularly, the present invention relates to a method and apparatus for performing data prefetch in a multiprocessor system.
2. Description of Related Art
A processor commonly includes a cache memory for storing data that are most recently accessed by the processor. When the processor requires data from a system memory, the processor first checks its cache memory to determine if the data are available locally. If the data are available in the cache memory and are valid, the processor can immediately use the data from the cache memory. However, if the data are not present in the cache memory or are invalid, then the processor must access the system memory to retrieve the data.
By using prefetching techniques, a cache memory can request data from a system memory before a processor makes a request for the data. In other words, data required by the processor can be retrieved from the system memory before the processor requires the data. By prefetching data ahead of data consumption by the processor, data can be continuously supplied to the processor without interruption. Prefetch operations allow more time for the system memory to access and provide data in anticipation of upcoming processor requests, thereby enhancing overall system performance.
The amount of time necessary for a processor to access a system memory is called memory latency. In order to maximize the efficiency of the processor, the amount of data that needs to be prefetched can be determined by the speed of the processor relative to the memory latency. Faster processors tend to benefit from a larger amount of prefetched data, particularly when memory latency is high.
However, prefetch operations also have their drawbacks. Prefetch operations are speculative in nature; thus, if the prefetched data are not ultimately utilized by the processor, then time and input/output resources will be wasted. In addition, prefetch activities consume bus bandwidth that could have been better utilized for fetching other data that are actually requested by the processor.
The present disclosure provides an improved method and apparatus for performing data prefetch in a multiprocessor system.